<!DOCTYPE html>
    <html>
    <head>
    	<meta charset="utf-8">
    	<title>微信云端配置</title>
    	<link rel="stylesheet" href="<?=adminassets?>assets/pear/component/pear/css/pear.css" />
    </head>
    <body class="pear-container">
    <?php if ($my == "list") : ?>
    	<div class="layui-card">
		<div class="layui-card-body">
			<form class="layui-form" action="">
				<div class="layui-form-item">
					<div class="layui-form-item layui-inline">
						<label class="layui-form-label">搜索</label>
						<div class="layui-input-inline">
							<select name="type">
							<option value="url">云端接口</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item layui-inline">
						<label class="layui-form-label">搜索内容</label>
						<div class="layui-input-inline">
							<input type="text" name="msg" placeholder="搜索内容" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item layui-inline">
						<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
							<i class="layui-icon layui-icon-search"></i>
							查询
						</button>
						<button type="reset" class="pear-btn pear-btn-md">
							<i class="layui-icon layui-icon-refresh"></i>
							重置
						</button>
					</div>
				</div>
			</form>
		</div>
	</div>
    <div class="layui-card">
			<div class="layui-card-body">
				<table id="news" lay-filter="news"></table>
			</div>
		</div>

		<script type="text/html" id="toolbar">
			<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
				<i class="layui-icon layui-icon-add-1"></i>
				新增云端
			</button>
		</script>


		<script type="text/html" id="status">
			<input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="正常|封禁" lay-filter="status" {{# if(d.status==1){ }} checked {{# } }}>
		</script>
		<script type="text/html" id="options">
			<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
			<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
		</script>
	<?php endif; ?>	
	<?php if ($my == "add") : ?>
	    <form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
					<div class="layui-form-item">
						<label class="layui-form-label">
						云端名称
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="name"  value="" placeholder="可填云端地区等 不可为空"/>
						</div>
					</div>
				
					<div class="layui-form-item">
						<label class="layui-form-label">
						云端地址
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="url"  value="" placeholder="需要填完整的地址 不可为空"/>
						</div>
					</div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">云端类型</label>
                        <div class="layui-input-block">
                            <select name="code" default="">
                                <option value="">请选择云端类型</option>
                                <option value="1">MAC</option>
                                <option value="2">UOS</option>
                                <option value="3">IPAD</option>
                            </select>
                        </div>
                    </div>
				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="addSave">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
	<?php endif; ?>	
	<?php if ($my == "edit") : ?>
	    <form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
				<input type="hidden" name="id" disabled value="<?=$id?>" />
					<div class="layui-form-item">
						<label class="layui-form-label">
							云端名称
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="name"  value="<?=$row['name']?>" placeholder="不可为空"/>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							云端地址
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="url"  value="<?=$row['url']?>" />
						</div>
					</div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">云端类型</label>
                        <div class="layui-input-block">
                            <select name="code" default="">
                                <option value="">请选择云端类型</option>
                                <option value="1" <?= $row['code'] == 1 ? "selected" : "" ?>>MAC</option>
                                <option value="2" <?= $row['code'] == 2 ? "selected" : "" ?>>UOS</option>
                                <option value="3" <?= $row['code'] == 3 ? "selected" : "" ?>>IPAD</option>
                            </select>
                        </div>
                    </div>
				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="editSave">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
	<?php endif; ?>	
	<script src="<?=adminassets?>assets/pear/component/layui/layui.js"></script>
	<script src="<?=adminassets?>assets/pear/component/pear/pear.js"></script>
	<script src="<?=adminassets?>assets/js/core_js/wxyunurl.js?v=<?=time()?>"></script>